using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using _17bang.Entities;
using _17bang.Repositories;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;

namespace _17bang.Pages
{
    public class UserPageModel : PageModel
    {
        public User PaUser { get; set; }
        private UserRepository userRepository;
        public UserPageModel()
        {
            userRepository = new UserRepository();
        }
        public void OnGet()
        {
            int id = Convert.ToInt32(RouteData.Values["id"]);
            PaUser = userRepository.Find(id); 
        }
    }
}
